import axios from '@/utils/request'
export default {
  OrderShipping: {
    list: {
      disabled_actions: ['lines', 'delete', 'edit'],
      query: {
        '@order': `entity.createdTime|DESC`
      },
      list_filter: {
        'store.id': () => {
          return axios
            .get(`/manage/stores`)
            .then(res =>
              Object.assign({ __label: '门店' },
                ...res.data.map(v => { return { [v.id]: v.name } })))
        },
        'stock.specification.product.name': '产品',
        startTime: {
          expression: `
          entity.getCreatedTime() >= datetime.get(":value")
        `,
          label: '开始时间',
          type: 'datetime'
        },
        endTime: {
          expression: `
          entity.getCreatedTime() < datetime.get(":value")
        `,
          label: '结束时间',
          type: 'datetime'
        }
      },
      list_display: [
        'orderItem',
        'quantity',
        'createdTime'
      ]
    },
    form: {
      fields: [
      ]
    }
  }
}

